package com.farm.device.controller;

import com.farm.device.pojo.DeviceIndex;
import com.farm.device.service.DeviceIndexService;
import com.farm.entity.Result;
import com.farm.entity.StatusCode;
import com.farm.feign.IndexFeign;
import com.farm.opjo.Index;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/deviceIndex")
public class DeviceIndexController {

    @Autowired
    private DeviceIndexService deviceIndexService;

    @Autowired
    private IndexFeign indexFeign;

    @GetMapping("/findByDid/{did}")
    public Result findByDid(@PathVariable("did") Integer did ){


        List <DeviceIndex> byId = deviceIndexService.findByDid(did);
        return new Result(true, StatusCode.OK,"查询成功",byId);
    }
}
